<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
<head>
<title>游戏难度统计 </title>
<base href="<%=basePath%>" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="i/buyu.ico">
<link rel="apple-touch-icon-precomposed" href="i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="layui/css/layui.css">


<style type="text/css">
.waterTable tr td {
	background: #f3f4f6;
}

.water-field {
	font-size: 16px;
	font-weight: bold;
}

.info-field {
	border-bottom: 0;
}

.edit-field {
	display: none;
}

.tpl-block {
	font-size: 14px;
}
</style>
</head>
<%
	String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
%>
<body>
	<table class="layui-hide" id="StatisticsGameDifficult"></table>

	<script type="text/html" id="Game">
            {{#  if(d.GroupId == 1 && d.ServiceId === 1){ }}
                <span>3D捕鱼</span>
            {{#  } else if(d.GroupId == 1 && d.ServiceId === 4){ }}
                <span>集结号捕鱼捕鱼</span>
            {{#  } else if(d.GroupId == 3 && d.ServiceId === 0){ }}
                <span>拉霸机</span>
            {{#  } else if(d.GroupId == 4 && d.ServiceId === 0){ }}
                <span>打地鼠</span>
            {{#  } else if(d.GroupId == 7 && d.ServiceId === 0){ }}
                <span>龙虎斗</span>
            {{#  } else if(d.GroupId == 9 && d.ServiceId === 0){ }}
                <span>性感女郎</span>
            {{#  } }}
    </script>
    
    <script type="text/html" id="DifficultyLevel">
            {{#  if(d.DifficultyLevel == 0){ }}
                <span class="layui-badge">地域灾难</span>
            {{#  } else if(d.DifficultyLevel == 1){ }}
                <span class="layui-badge">非常困难</span>
            {{#  } else if(d.DifficultyLevel == 2){ }}
                <span class="layui-badge">困难</span>
            {{#  } else if(d.DifficultyLevel == 3){ }}
                <span class="layui-badge">中等</span>
            {{#  } else if(d.DifficultyLevel == 4){ }}
                <span class="layui-badge">简单</span>
            {{#  } else if(d.DifficultyLevel == 5){ }}
                <span class="layui-badge">分红</span>
            {{#  } else if(d.DifficultyLevel == 6){ }}
                <span class="layui-badge">大富豪</span>
            {{#  } }}
    </script>
	
	<script src="js/jquery.min.js"></script>
    <script src ="layui/layui.js"></script>
    
    <script>
    	layui.use(['layer','table'],function(){
    		var layer = layui.layer;
    		var table  = layui.table;
    		
    		table.render({
    			elem : '#StatisticsGameDifficult',
    			url : 'Room/StatisticsGameDifficult',
    			method : 'post',
    			title : '统计游戏记录列表',
    			totalRow : true,
    			cellMinWidth : 80, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
				id:'AttTable',
				cols : [ [ 
					{field : 'GroupId',title : '游戏组ID',hide:true},
					{field : 'ServiceId',title : '游戏ID',hide:true},
					{field : 'Game',title : '游戏',templet:'#Game'},
					{field : 'DifficultyLevel',title : '难度级别',templet:'#DifficultyLevel'},
					{field : 'Operater',title : '操作人'},
					{field : 'CreateTime',title : '操作时间'}
					] ],
					page : true,
					response : {
						statusCode : 200
					},
					parseData : function(res){
						return {
							"code" : res.status, //解析接口状态
							"msg" : res.message, //解析提示文本
							"count" : res.count, //解析数据长度
							"data" : res.data //解析数据列表
						//解析数据列表
						};
					}
    		});
    		
    		setInterval(function(){
              	table.reload('AttTable', {
              		page:{
              			curr:1
              		}
              	});
              },60000);
    	});
    	
    </script>
</body>

</html>